<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>main</title>
<jsp:include page="../head.jsp" />
<script type="text/javascript">

	function save(){
		if(trim($("#companyName").val())==""){
			addError("companyName","公司名称不能为空.");
			return;
		}else if(trim($("#companyNo").val())==""){
			addError("companyNo","公司编号不能为空.");
			return;
		}else if(trim($("#companyLegalPerson").val())==""){
			addError("companyLegalPerson","法人代表不能为空.");
			return;
		}
		if (!checkForm(document.getElementById("saveForm"))) {
			return;
		}
		xbox.load("loading");	
		$("#saveForm").ajaxSubmit(function(){
			$("#refreshForm").submit();
	    });
	}
	function turnBack(){
	   $("#refreshForm").submit();
	}

</script>

</head>
<body>
<form action="<%=path%>/company/company_modify_listAction.action" method="post" id="saveForm">
<table width="98%" align="center" border="0" cellpadding="4" cellspacing="1" bgcolor="#F1F1F1" style="margin-bottom:8px">
  <tr bgcolor="#FFFFFF">
    <td colspan="4" height="16"><span></span></td>
  </tr>
  <tr bgcolor="#FFFFFF">
    <td width="10%" align="right" bgcolor="#FFFFFF"><span style="color:red;">*</span>公司名称：</td>
    <td width="40%" align="left" bgcolor="#FFFFFF">
              <input maxlength="25" type="text" name="company.companyName" id="companyName" value="${company.companyName}" />
    </td>
    <td width="10%" align="right" bgcolor="#FFFFFF"><span style="color:red;">*</span>公司编号：</td>
    <td width="40%" align="left" bgcolor="#FFFFFF">
              <input maxlength="25" type="text" name="company.companyNo" id="companyNo" value="${company.companyNo}" />
    </td>
  </tr>
   <tr bgcolor="#FFFFFF">
    <td width="10%" align="right" bgcolor="#FFFFFF">母公司：</td>
    <td width="40%" align="left" bgcolor="#FFFFFF">
              <select id="parentCompanyId" name="company.parentCompanyId">
			    	<option value="0">&nbsp;&nbsp;&nbsp;&nbsp;</option>
			    	<c:forEach items="${motherCompanyList}" var="mother">
			    	<option <c:if test="${mother.companyId eq company.parentCompanyId}">selected="selected"</c:if> value="${mother.companyId}"><c:out value="${mother.companyName}" /></option>
			    	</c:forEach>
			    </select>
    </td>
    <td width="10%" align="right" bgcolor="#FFFFFF"><span style="color:red;">*</span>法人代表：</td>
    <td width="40%" align="left" bgcolor="#FFFFFF">
              <input type="text" name="company.companyLegalPerson" id="companyLegalPerson" value="${company.companyLegalPerson}" />
    </td>
  </tr>
   <tr bgcolor="#FFFFFF">
    <td width="10%" align="right" bgcolor="#FFFFFF">电话：</td>
    <td width="40%" align="left" bgcolor="#FFFFFF">
              <input type="text" name="company.companyPhone" id="companyPhone" value="${company.companyPhone}" />
    </td>
    <td width="10%" align="right" bgcolor="#FFFFFF">Email：</td>
    <td width="40%" align="left" bgcolor="#FFFFFF">
              <input type="text" name="company.companyEmail" id="companyEmail" value="${company.companyEmail}" />
    </td>
  </tr>
  <tr bgcolor="#FFFFFF">
    <td width="10%" align="right" bgcolor="#FFFFFF">传真：</td>
    <td width="40%" align="left" bgcolor="#FFFFFF">
               <input type="text" name="company.companyFax" id="companyFax" value="${company.companyFax}" />
    </td>
    <td width="10%" align="right" bgcolor="#FFFFFF">地址：</td>
    <td width="40%" align="left" bgcolor="#FFFFFF">
               <input type="text" name="company.companyAddress" id="companyAddress" value="${company.companyAddress}" />
    </td>
  </tr>
  <tr bgcolor="#FFFFFF">
    <td width="10%" align="right" bgcolor="#FFFFFF">经营范围：</td>
    <td width="40%" align="left" bgcolor="#FFFFFF">
               <input type="text" name="company.companyProject" id="companyProject" value="${company.companyProject}" />
    </td>
    <td width="10%" align="right" bgcolor="#FFFFFF">成立时间：</td>
    <td width="40%" align="left" bgcolor="#FFFFFF">
               <input type="text" name="company.companyBirthday" id="companyBirthday" value="${company.companyBirthday}" />
    </td>
  </tr>
  <tr bgcolor="#FFFFFF">
    <td width="10%" align="right" bgcolor="#FFFFFF">备注：</td>
    <td width="90%" colspan="3" align="left" bgcolor="#FFFFFF">
               <textarea rows="3" name="company.remark" id="remark">${company.remark}</textarea>
    </td>
  </tr>
  <tr align="right" bgcolor="#F1F1F1">
	<td height="36" colspan="4" align="center">
		<input type='button' class="btn btn-primary" id="btnSave" onclick="save();" value='保存' />
	    &nbsp;<input type='button' class="btn" onclick="turnBack();" value='返回' />
</td>
</tr>
</table>
<input type="hidden" name="company.companyId" value="${company.companyId}" />
<input type="hidden" name="company.createTime" value='<fmt:formatDate value="${company.createTime}" pattern="yyyy-MM-dd HH:mm:ss"/>' />
<input type="hidden" name="company.deleteFlag" value="${company.deleteFlag}" />
</form>


<form action="${listUrl}" method="post" style="display: none;" id="refreshForm" name="refreshForm"/>
</body>
</html>
